function LimitInputWidth(oInput, nMaxLen) {
    if (!oInput) {
        console.log('LimitInputWidth()--> arg[0] must be object!');
        return;
    }
    if ('number' != typeof nMaxLen) {
        console.log('LimitInputWidth()--> arg[1] must be number!');
        return;
    }
    var nCount = 0;
    //length 获取字数数，不区分汉子和英文
    for (var i = 0; i < oInput.value.length; i++) {
        //charCodeAt()获取字符串中某一个字符的编码
        var nCharCode = oInput.value.charCodeAt(i);
        //单字节加1
        if ((0x0001 <= nCharCode && nCharCode <= 0x007e) || (0xff60 <= nCharCode && nCharCode <= 0xff9f)) {
            ++nCount;
        } else {
            nCount += 2;
        }
        if (nCount > nMaxLen) {
            oInput.value = oInput.value.substr(0, i);
            break;
        }
    }
}

Date.prototype.Format = function (fmt) {
    var o = {
        "M+": this.getMonth() + 1, //月份
        "d+": this.getDate(), //日
        "h+": this.getHours(), //小时
        "m+": this.getMinutes(), //分
        "s+": this.getSeconds(), //秒
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
        "S": this.getMilliseconds() //毫秒
    };
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}

function dateYMDFormat(value) {
    if (value) {
        return new Date(value).Format("yyyy-MM-dd")
    }
    return "";
}

function dateYMDHMSFormat(value) {
    if (value) {
        return new Date(value).Format("yyyy-MM-dd hh:mm:ss")
    }
    return "";
}